<html>
<body>


<?php
$dbc = mysqli_connect('localhost', 'online_shopper', 'shop', 'online_shop')
or die('Error connecting to db');

$login = $_POST['login'];
$password = sha1($_POST['pwd']);

$query = "select personID from Login".
        " where login = '$login' and pwd = '$password'";

$result = mysqli_query($dbc, $query) or die('Error querying db');
$result1 = mysqli_fetch_array($result);

$id = $result1['personID'];


$query2 = "select firstName, lastName from Person".
        " where iD = '$id'";
 
        
$result3 = mysqli_query($dbc,$query2)or die('error query2');



while($row = mysqli_fetch_array($result3)) {
    print $row['firstName'] ' ';
}


?>

</body>
</html>

